<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //将大于45 的元素筛选出来，放入新的数组里面。
        function filterArr (arr){
            var temArr = [];
            for (var i = 0; i < arr.length; i++){
                if(arr[i] > 35){
                    temArr.push(arr[i]);
                }
            }
            return temArr;
        }
        var result = filterArr([45, 7, 78, 25, 452, 70]);
        console.log(result);//[45, 78, 452, 70]
    </script>
</body>
</html>